]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
More gracefully handle a situation where starting shell failed
authorColin Walters <walters@verbum.org>
Wed, 9 Sep 2009 19:49:31 +0000 (15:49 -0400)
committerColin Walters <walters@verbum.org>
Wed, 9 Sep 2009 19:49:31 +0000 (15:49 -0400)
If start_shell() threw an exception before, we'd overwrite it with
an exception in the finally() clause.  Handle this and just print a message
and let the exception propagate.

src/gnome-shell.in

index 035ccd3e4b2960780dee363b2c270dd820793852..2acc967ed0d074e85c96d9e6b88b6605ff1a1535 100644 (file)
@@ -253,6 +253,7 @@ if options.debug:
 normal_exit = False
 
 try:
+    shell = None
     if options.xephyr:
         xephyr = start_xephyr()
         # This makes us not grab the org.gnome.Panel name
@@ -281,7 +282,9 @@ finally:
         except OSError:
             pass
 
-    if shell.returncode ==  0:
+    if shell is None:
+        print "Failed to start shell"
+    elif shell.returncode == 0:
         normal_exit = True
         if options.verbose:
             print "Shell exited normally"